Socket
Socket
Sign inDemoInstall

@manypkg/get-packages

Package Overview
Dependencies
6
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@manypkg/get-packages


Version published
Weekly downloads
803K
decreased by-14.84%
Maintainers
2
Install size
2.54 MB
Created
Weekly downloads
 

Readme

Source

@manypkg/get-packages

A simple utility to get the packages from a monorepo, whether they're using Yarn, Bolt or pnpm

This library exports getPackages and getPackagesSync. It is intended mostly for use of developers building tools that want to support different kinds of monorepos as an easy way to write tools without having to write tool-specific code. It supports Yarn, Bolt, pnpm and single-package repos(where the only package is the the same as the root package). This library uses @manypkg/find-root to search up from the directory that's passed to getPackages or getPackagesSync to find the project root.

import { getPackages, getPackagesSync } from "@manypkg/get-packages";

const { tool, root, packages } = await getPackages(process.cwd());
const { tool, root, packages } = getPackagesSync(process.cwd());

type Tool = "yarn" | "bolt" | "pnpm" | "root";

type Package = { packageJson: PackageJSON; dir: string };

type Packages = {
  tool: Tool;
  packages: Package[];
  root: Package;
};

FAQs

Last updated on 09 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc